﻿<UserControl x:Class="TestVisioCanvas.RoomWizard"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:ext="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
             xmlns:contents="clr-namespace:TestVisioCanvas.Helpers"
             mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="800">    
    <UserControl.Resources>
        <XmlDataProvider x:Key="WizardOptions" Source="/Data/WizardOptions.xml"
                         XPath="Options"/>
        <DataTemplate x:Key="OptionsTemplate">            
            <StackPanel>
                <Image x:Name="OptionImage" MinHeight="100" MinWidth="200" 
                    MaxWidth="200" MaxHeight="200" Source="{Binding XPath=ImagePath}"
                    Stretch="Uniform"/>
                <TextBlock x:Name="OptionName" TextAlignment="Center" FontSize="18" 
                    Text="{Binding XPath=Name}"/>
            </StackPanel>        
        </DataTemplate>
    </UserControl.Resources>
    <Grid>
        <ext:Wizard HelpButtonVisibility="Collapsed" Finish="Wizard_Finish">
            <!--<ext:WizardPage x:Name="Intro"
                Title="Creazione arredamento guidata"
                Description="La creazione guidata ti consentirà di..."
                            HelpButtonVisibility="Collapsed">                                
            </ext:WizardPage>-->
            <ext:WizardPage x:Name="PaperSetup"
                Title="Scegli il tuo foglio da disegno">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height=".5*"/>
                        <RowDefinition Height=".5*"/>
                    </Grid.RowDefinitions>
                    <!--<Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.5*"/>
                        <ColumnDefinition Width="0.5*"/>
                    </Grid.ColumnDefinitions>-->
                    <Border CornerRadius="30" BorderThickness="1" Grid.Row="0" 
                        MaxHeight="240" HorizontalAlignment="Left">
                        <ListBox HorizontalAlignment="Center" SelectedIndex="0" Name="_lbPaperSize"
                            ItemTemplate="{StaticResource ResourceKey=OptionsTemplate}">
                            <ListBox.ItemsSource>
                                <Binding Source="{StaticResource WizardOptions}"
                                XPath="Option[@type='PaperFormat']"/>
                            </ListBox.ItemsSource>
                            <ListBox.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Horizontal"/>
                                </ItemsPanelTemplate>
                            </ListBox.ItemsPanel>                            
                        </ListBox>
                    </Border>
                    <Border CornerRadius="30" BorderThickness="1" Grid.Row="1" 
                        MaxHeight="240" Margin="0,10,0,0" HorizontalAlignment="Left">
                        <ListBox HorizontalAlignment="Center" SelectedIndex="0" Name="_lbScale"                            
                            ItemTemplate="{StaticResource ResourceKey=OptionsTemplate}">
                            <ListBox.ItemsSource>
                                <Binding Source="{StaticResource WizardOptions}"
                                XPath="Option[@type='Scale']"/>
                            </ListBox.ItemsSource>
                            <ListBox.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Horizontal"/>
                                </ItemsPanelTemplate>
                            </ListBox.ItemsPanel>                            
                        </ListBox>
                    </Border>
                </Grid>
            </ext:WizardPage>
            <ext:WizardPage x:Name="RoomSetup"
                Title="Aggiungi La stanza" CanFinish="True" CanSelectPreviousPage="True">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height=".5*"/>
                        <RowDefinition Height=".5*"/>
                    </Grid.RowDefinitions>
                    <!--<Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.5*"/>
                        <ColumnDefinition Width="0.5*"/>
                    </Grid.ColumnDefinitions>-->
                    <Border CornerRadius="30" BorderThickness="1" Grid.Row="0" 
                        MaxHeight="240" HorizontalAlignment="Left">
                        <ListBox HorizontalAlignment="Center" SelectedIndex="0" Name="_lbRoomType"                            
                            ItemTemplate="{StaticResource ResourceKey=OptionsTemplate}">
                            <ListBox.ItemsSource>
                                <Binding Source="{StaticResource WizardOptions}"
                                XPath="Option[@type='RoomType']"/>
                            </ListBox.ItemsSource>
                            <ListBox.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Horizontal"/>
                                </ItemsPanelTemplate>
                            </ListBox.ItemsPanel>                            
                        </ListBox>
                    </Border>
                    <Border CornerRadius="30" BorderThickness="1" Grid.Row="1" 
                        MaxHeight="240" Margin="20">
                        <Grid MaxHeight="200">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width=".2*"/>
                                <ColumnDefinition Width=".3*"/>
                                <ColumnDefinition Width=".5*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height=".5*"/>
                                <RowDefinition Height=".5*"/>
                            </Grid.RowDefinitions>
                            
                            <TextBlock x:Name="LungLabel" Height="40" Text="Larghezza" 
                                FontSize="24" Grid.Row="0" Grid.Column="0"/>
                            <TextBlock Height="{Binding ElementName=LungLabel, Path=Height}" 
                                Text="Lunghezza" FontSize="24" Grid.Row="1" Grid.Column="0"/>
                            
                            <TextBox Height="{Binding ElementName=LungLabel, Path=Height}" 
                                     MaxWidth="200" Grid.Row="0" FontSize="24" Grid.Column="1"
                                     Name="_TBLength" Text="400"/>
                            <TextBox Height="{Binding ElementName=LungLabel, Path=Height}" 
                                     MaxWidth="200" Grid.Row="1" FontSize="24" Grid.Column="1"
                                     Name="_TBWidth" Text="400"/>
                            
                            <TextBlock Height="{Binding ElementName=LungLabel, Path=Height}" 
                                Text="Cm" FontSize="24" Grid.Row="1" Grid.Column="2"/>
                            <TextBlock Height="{Binding ElementName=LungLabel, Path=Height}" 
                                Text="Cm" FontSize="24" Grid.Row="0" Grid.Column="2"/>
                            
                        </Grid>                        
                    </Border>
                </Grid>
            </ext:WizardPage>
        </ext:Wizard>
    </Grid>
</UserControl>
